// import _ from "lodash";
// /**
//  * @param {Object} fields
//  * @param {Array} ignores
//  * @return {Object}
//  */
// export const resetFields = (fields = {}, ignores = []) => {
//   if (!fields) return {};
//   // const type = Object.prototype.toString;
//   let newFields = { ...fields };
//   Object.entries(newFields).forEach(([key, value]) => {
//     if (!ignores.includes(key)) {
//       if (_.isString(value)) newFields[key] = "";
//       if (_.isNumber(value)) newFields[key] = null;
//       if (_.isArray(value)) newFields[key] = [];
//       if (_.isBoolean(value)) newFields[key] = false;
//       if (_.isNaN(value)) newFields[key] = 0;
//       if (_.isNull(value)) newFields[key] = null;
//       if (_.isUndefined(value)) newFields[key] = null;
//       if (_.isObject(value)) newFields[key] = {};
//       if (_.isFunction(value)) newFields[key] = null;
//     }
//   });
//   return newFields;
// };

export const uuid = () => {
  let d = new Date().getTime();
  return "xxxxxxxxxxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
    let r = (d + Math.random() * 16) % 16 | 0;
    d = Math.floor(d / 16);
    return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
  });
};
